package com.twu.biblioteca;

import java.util.ArrayList;

public class MovieList {

    private ArrayList<Movie> list;

    public MovieList() {
        this.list = new ArrayList<Movie>();
    }

    public void add(Movie movie)
    {
        list.add(movie);

    }

    public String getMovieList() {
        String movieListHeader = "Movie\tYear\tDirector\tRating\n";
        String movies = "";
        for(Movie movie : list) {
            movies = movies.concat(movie.getName() + '\t' + movie.getYear() + '\t' + movie.getDirector() + '\t'
                    + movie.getRating() + '\n');
        }
        return movieListHeader + movies;
    }
}
